package common;

import java.util.ArrayList;

public final class Message extends ControlMessage {
	
	private static final long serialVersionUID = 7707092922021867539L;
	
	private final String str;
	
	private final String who;
	
	private final int roomID;
	
	public boolean client = true;
	
	private final ArrayList<String> list;
	
	public Message(MessageType type) {
		this(type, null, null, null, -1);
	}
	
	public Message(MessageType type, String str) {
		this(type, str, null, null, -1);
	}
	
	public Message(MessageType type, String str, boolean client) {
		this(type, str, null, null, -1);
		this.client = client;
	}
	
	public Message(MessageType type, String str, ArrayList<String> list, String who, int roomID) {
		super(type);
		
		this.roomID = roomID;
		this.who = who;
		this.str = str;
		this.list = list;
	}
	
	public Message(ControlMessage msg, boolean success) {
		super(msg, success);
		
		this.roomID = -1;
		this.str = null;
		this.list = null;
		this.who = null;
	}
	
	public String getStr() {
		return str;
	}
	
	public ArrayList<String> getList() {
		return list;
	}
	
	public String getWho() {
		return this.who;
	}
	
	public int getRoomID() {
		return this.roomID;
	}
}
